#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
const LL MAXN=1e5+7;
int prime[MAXN], p_cnt;
bool isP[MAXN];
void Init() {
	memset(isP, 1, sizeof(isP));
	p_cnt=0;
	for (int i=2; i<MAXN; ++i) {
		if (isP[i]) prime[p_cnt++]=i;
		for (int j=0; j<p_cnt&&((LL)i)*prime[j]<MAXN; ++j) {
			isP[i*prime[j]]=false;
			if (i%prime[j]==0) break;
		}
	}
}
LL Solve(LL ask) {
	LL res=0;
	LL cnt=0;
	for (int i=0; i<p_cnt&&ask!=1; ++i) {
		if (ask%prime[i]==0) {
			++cnt;
			LL t=1;
			while (ask%prime[i]==0) {
				t=t*prime[i];
				ask/=prime[i];
			}
			res+=t;
		}
	}
	if (ask!=1) {
		++cnt;
		res+=ask;
	}
	if (cnt==1) res+=1;
	if (cnt==0) return 2;
	return res;
}
int main(int argc, char** argv) {
	int cas=1;
	LL ask;
	Init();
	while (cin>>ask && ask) {
		printf("Case %d: %lld\n", cas, Solve(ask));
		++cas;
	}
	return 0;
} 
